<!-- 消息提醒 -->
<template>
  <div>
    <el-button type="text" size="medium">
      <el-badge :value="count" :max="99">
        <svg-icon class="svgClass" icon-class="email" @click="click" />
      </el-badge>
    </el-button>
  </div>
</template>

<script>

import {countNotice} from "@/api/system/notice";
import {getCount} from "@/utils/massage";
let timer = 0;

export default {
  name: "index",
  data() {
    return {
      count: undefined,
      routerOptions: [],
    }
  },
  created() {
    this.getMassageCount();
    setInterval(() => {
      this.count = this.getCount();
    },500)
    this.getDicts("sys_router").then(response => {
      this.routerOptions = response.data;
    });
  },
  methods: {
    // 页面路由字典翻译
    routerFormat(row, column) {
      return this.selectDictLabel(this.routerOptions, row);
    },
    click() {
      var location = this.routerFormat("OrderNotice");
      // var location = '/mall/notice';
      this.$router.push({'path':location, 'query': {}})
    }
  }
}
</script>

<style lang="scss" scoped>
.svgClass {
  display: inline-block;
  cursor: pointer;
  fill: #5a5e66 !important;
  width: 22px !important;
  height: 22px !important;
  vertical-align: 0px !important;
}
</style>
